package com.yjs.app.trade.service.service.sys.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yjs.app.trade.core.base.mybatis.dbutil.DynamicSwitchDataSource;
import com.yjs.app.trade.entity.base.util.Page;
import com.yjs.app.trade.entity.bean.PassportSearch;
import com.yjs.app.trade.service.mapper.sys.MessagePushMapper;
import com.yjs.app.trade.service.service.sys.MessagePushService;

@Service("messagePushService")
@DynamicSwitchDataSource(dataSource = "app")
public class MessagePushServiceImpl implements MessagePushService {
	
	@Autowired
	MessagePushMapper messagePushMapper;

	@Override
	public int saveMessagePush(List<Map<String, Object>> list) {
		return messagePushMapper.saveMessagePush(list);
	}

	@Override
	public Page<?> findMessageByPassportId(Page<PassportSearch> page, PassportSearch passportSearch) {
		passportSearch.setPage(page);
		List<Map<String, Object>> result = messagePushMapper.findMessageByPassportId(passportSearch);
		page.setMaps(result);
		return page;
	}

	@Override
	public Integer countUnReadMessageNumber(String id) {
		Integer number = messagePushMapper.countUnReadMessageNumber(id);
		return number;
	}

	@Override
	public int updataIsCheck(Map<String, Object> map) {
		int updataIsCheck = messagePushMapper.updataIsCheck(map);
		return updataIsCheck;
	}

	@Override
	public int checkTagIsPush(String tagId, int type) {
		return messagePushMapper.checkTagIsPush(tagId, type);
	}

	
}
